package com.design.patterns;

interface Sender1{
    void sender();
}

class MailSender1 implements Sender1{
    public void sender(){
        System.out.println("this is mail sender");
    }
}

class SmsSender1 implements Sender1{
    public void sender(){
        System.out.println("this is sms sender");
    }
}

class SendFactory{
    public Sender1 produceMail(){
        return new MailSender1();
    }

    public Sender1 produceSms(){
        return new SmsSender1();
    }
}
//工厂设计模式-多工厂方法模式
public class FactoryPattern1 {

    public static void main(String[] args) {
        SendFactory sendFactory = new SendFactory();
        Sender1 s1 = sendFactory.produceMail();
        s1.sender();
        Sender1 s2 = sendFactory.produceSms();
        s2.sender();
    }



}
